Skip to content

chore: use valueOf instead of deprecated boxing constructors in FlagTest - #392

Closed
abelonogov-ld wants to merge 1 commit into
mainfrom
andrey/flagtest-boxing-deprecation
Closed

chore: use valueOf instead of deprecated boxing constructors in FlagTest#392
abelonogov-ld wants to merge 1 commit into
mainfrom
andrey/flagtest-boxing-deprecation

Conversation

@abelonogov-ld

@abelonogov-ld abelonogov-ld commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Why

The build compiles with -Xlint:deprecation, so three new Integer(...) / new Long(...) calls in FlagTest print warnings on every CI run:

FlagTest.java:159: warning: [deprecation] Integer(int) in Integer has been deprecated
FlagTest.java:246: warning: [deprecation] Long(long) in Long has been deprecated
FlagTest.java:251: warning: [deprecation] Long(long) in Long has been deprecated

valueOf is the direct replacement. Overload resolution is unchanged — the arguments are still boxed types, so these remain assertEquals(Object, Object) calls comparing the same values.

Test plan

  • FlagTest passes
  • Recompiled the unit test source set and confirmed these three warnings are gone

Nothing shipped changes, so this is chore and should not cut a release.

Note: CI on this branch may hit the FDv2DataSourceTest flake until #390 merges, since this branch is on current main.


Note

Overview
Test-only cleanup in FlagTest: three assertEquals expectations now use Integer.valueOf(2) and Long.valueOf(...) instead of deprecated new Integer(...) / new Long(...), so -Xlint:deprecation no longer warns on those lines during CI.

Behavior is unchanged—the same boxed values are compared via assertEquals(Object, Object) overload resolution.

Reviewed by Cursor Bugbot for commit 12a0505. Bugbot is set up for automated code reviews on this repo. Configure here.

The build compiles with -Xlint:deprecation, so these three calls print
warnings on every run.

Co-authored-by: Cursor <cursoragent@cursor.com>
@abelonogov-ld
abelonogov-ld requested a review from a team as a code owner August 17, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant